
public class SeqSearch {
    public static void main(String[] args) {
        int[] arr = new int[80000];
        for (int i = 0; i < 80000; i++) {
            arr[i] = (int) (Math.random() * 80000);

        }
        long start = System.currentTimeMillis();
        long end = System.currentTimeMillis();
        System.out.println(seqSearch(arr,arr[25000]));
        System.out.println(start-end+"ms");
    }
    //找到一个就返回
    public static int seqSearch(int[] arr,int value){
        for (int i = 0; i < arr.length; i++) {
            if (arr[i]==value){
                return i;
            }
        }
        return -1;
    }
}
